package com.shanzmoo.db.module.psys.domain.vo;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.module.psys.entity.PSysMenuEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 *
 * @author Gzhao
 * @date 2020/11/16
 */
@Data
@ApiModel("菜单树对象")
public class MenuTreeVO {

    @ApiModelProperty("菜单Id" )
    private Integer menuId;

    @ApiModelProperty("菜单名称" )
    private String menuName;

    @ApiModelProperty("子菜单" )
    private List<MenuTreeVO> children;

    /*public static MenuTreeVo create(MenuEntity menuEntity) {
        return JSON.parseObject(JSON.toJSONString(menuEntity), MenuTreeVo.class);
    }*/

    public static MenuTreeVO create(PSysMenuEntity menuEntity) {
        return JSON.parseObject(JSON.toJSONString(menuEntity), MenuTreeVO.class);
    }
}
